package com.weilele.leisure.time.bean;

import android.text.TextUtils;

import com.google.gson.annotations.SerializedName;
import com.google.gson.internal.LinkedTreeMap;

import java.util.ArrayList;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;

public class VideoDetailBean {

    /**
     * id : 209274
     * type_id : 13
     * copyright : 0
     * type_parent_id : 2
     * title : 上阳赋
     * douban_score : 0.0
     * subtitle :
     * alias : shangyangfu
     * ext_types : ["国产"]
     * tag : 章子怡,古装,帝王业,电视剧,国产电视剧,小说改编,国产剧,周一围
     * points : false
     * not_try : 0
     * pic : mac://ae01.alicdn.com/kf/U764eb9e8072943bba7fc2a30815a0a22v.jpg
     * pic_thumb :
     * pic_slide : https://ae01.alicdn.com/kf/Ucdf8e58beaeb45ada1c13d2a97c8999bv.jpg
     * actors : ["章子怡","周一围","杨祐宁","惠英红","赵雅芝","史可","于和伟","左小青"]
     * director : ["侯咏","程源海"]
     * writer :
     * blurb : 上阳郡主王儇出身望族，流淌着皇室血脉，容貌倾城、才情出众，拥有令人艳羡的人生谁料自及笄礼始，王儇就被无力阻挡的宿命卷入了棋局博弈之中，被数次当做交换的筹码，丞相父亲、皇帝舅舅、皇后姑母等人皆是幕后的弈
     * remarks : 全68集
     * pubdat :
     * total : 80
     * serial : 63
     * isend : 1
     * weekday :
     * area : ["大陆"]
     * lang : ["国语"]
     * year : 2021
     * version :
     * state :
     * level : 0
     * points_play : false
     * points_down : false
     * hits : 1015
     * hits_day : 1
     * hits_week : 1
     * hits_month : 1
     * up : 1
     * down : 1
     * score : 3.0
     * score_all : 717
     * score_num : 239
     * duration :
     * time : 2021-03-27
     * timeadd : 2021-01-06
     * players : [{"name":"蓝光无水印","key":"alizy","sort":"201","datas":[{"text":"第58集","play_url":"https://tst.cqzyw.net:11441/data/video/1613698770.m3u8"}]}]
     * type_name : 国产剧
     * type_parent_name : 连续剧
     * tags : [""]
     * topics : []
     */

    @SerializedName("id")
    private int id;
    @SerializedName("type_id")
    private int typeId;
    @SerializedName("copyright")
    private int copyright;
    @SerializedName("type_parent_id")
    private int typeParentId;
    @SerializedName("title")
    private String title;
    @SerializedName("douban_score")
    private String doubanScore;
    @SerializedName("subtitle")
    private String subtitle;
    @SerializedName("alias")
    private String alias;
    @SerializedName("ext_types")
    private List<String> extTypes;
    @SerializedName("tag")
    private String tag;
    @SerializedName("points")
    private boolean points;
    @SerializedName("not_try")
    private int notTry;
    @SerializedName("pic")
    private String pic;
    @SerializedName("pic_thumb")
    private String picThumb;
    @SerializedName("pic_slide")
    private String picSlide;
    @SerializedName("actors")
    private List<String> actors;
    @SerializedName("director")
    private List<String> director;
    @SerializedName("writer")
    private String writer;
    @SerializedName("blurb")
    private String blurb;
    @SerializedName("remarks")
    private String remarks;
    @SerializedName("pubdat")
    private String pubdat;
    @SerializedName("total")
    private int total;
    @SerializedName("serial")
    private String serial;
    @SerializedName("isend")
    private int isend;
    @SerializedName("weekday")
    private String weekday;
    @SerializedName("area")
    private List<String> area;
    @SerializedName("lang")
    private List<String> lang;
    @SerializedName("year")
    private String year;
    @SerializedName("version")
    private String version;
    @SerializedName("state")
    private String state;
    @SerializedName("level")
    private int level;
    @SerializedName("points_play")
    private boolean pointsPlay;
    @SerializedName("points_down")
    private boolean pointsDown;
    @SerializedName("hits")
    private int hits;
    @SerializedName("hits_day")
    private int hitsDay;
    @SerializedName("hits_week")
    private int hitsWeek;
    @SerializedName("hits_month")
    private int hitsMonth;
    @SerializedName("up")
    private int up;
    @SerializedName("down")
    private int down;
    @SerializedName("score")
    private String score;
    @SerializedName("score_all")
    private int scoreAll;
    @SerializedName("score_num")
    private int scoreNum;
    @SerializedName("duration")
    private String duration;
    @SerializedName("time")
    private String time;
    @SerializedName("timeadd")
    private String timeadd;
    @SerializedName("players")
    private List<PlayersDTO> players;
    @SerializedName("type_name")
    private String typeName;
    @SerializedName("type_parent_name")
    private String typeParentName;
    @SerializedName("tags")
    private List<String> tags;
    @SerializedName("topics")
    private List<?> topics;

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public int getTypeId() {
        return typeId;
    }

    public void setTypeId(int typeId) {
        this.typeId = typeId;
    }

    public int getCopyright() {
        return copyright;
    }

    public void setCopyright(int copyright) {
        this.copyright = copyright;
    }

    public int getTypeParentId() {
        return typeParentId;
    }

    public void setTypeParentId(int typeParentId) {
        this.typeParentId = typeParentId;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getDoubanScore() {
        return doubanScore;
    }

    public void setDoubanScore(String doubanScore) {
        this.doubanScore = doubanScore;
    }

    public String getSubtitle() {
        return subtitle;
    }

    public void setSubtitle(String subtitle) {
        this.subtitle = subtitle;
    }

    public String getAlias() {
        return alias;
    }

    public void setAlias(String alias) {
        this.alias = alias;
    }

    public List<String> getExtTypes() {
        return extTypes;
    }

    public void setExtTypes(List<String> extTypes) {
        this.extTypes = extTypes;
    }

    public String getTag() {
        return tag;
    }

    public void setTag(String tag) {
        this.tag = tag;
    }

    public boolean isPoints() {
        return points;
    }

    public void setPoints(boolean points) {
        this.points = points;
    }

    public int getNotTry() {
        return notTry;
    }

    public void setNotTry(int notTry) {
        this.notTry = notTry;
    }

    public String getPic() {
        return pic;
    }

    public void setPic(String pic) {
        this.pic = pic;
    }

    public String getPicThumb() {
        return picThumb;
    }

    public void setPicThumb(String picThumb) {
        this.picThumb = picThumb;
    }

    public String getPicSlide() {
        return picSlide;
    }

    public void setPicSlide(String picSlide) {
        this.picSlide = picSlide;
    }

    public List<String> getActors() {
        return actors;
    }

    public void setActors(List<String> actors) {
        this.actors = actors;
    }

    public List<String> getDirector() {
        return director;
    }

    public void setDirector(List<String> director) {
        this.director = director;
    }

    public String getWriter() {
        return writer;
    }

    public void setWriter(String writer) {
        this.writer = writer;
    }

    public String getBlurb() {
        return blurb;
    }

    public void setBlurb(String blurb) {
        this.blurb = blurb;
    }

    public String getRemarks() {
        return remarks;
    }

    public void setRemarks(String remarks) {
        this.remarks = remarks;
    }

    public String getPubdat() {
        return pubdat;
    }

    public void setPubdat(String pubdat) {
        this.pubdat = pubdat;
    }

    public int getTotal() {
        return total;
    }

    public void setTotal(int total) {
        this.total = total;
    }

    public String getSerial() {
        return serial;
    }

    public void setSerial(String serial) {
        this.serial = serial;
    }

    public int getIsend() {
        return isend;
    }

    public void setIsend(int isend) {
        this.isend = isend;
    }

    public String getWeekday() {
        return weekday;
    }

    public void setWeekday(String weekday) {
        this.weekday = weekday;
    }

    public List<String> getArea() {
        return area;
    }

    public void setArea(List<String> area) {
        this.area = area;
    }

    public List<String> getLang() {
        return lang;
    }

    public void setLang(List<String> lang) {
        this.lang = lang;
    }

    public String getYear() {
        return year;
    }

    public void setYear(String year) {
        this.year = year;
    }

    public String getVersion() {
        return version;
    }

    public void setVersion(String version) {
        this.version = version;
    }

    public String getState() {
        return state;
    }

    public void setState(String state) {
        this.state = state;
    }

    public int getLevel() {
        return level;
    }

    public void setLevel(int level) {
        this.level = level;
    }

    public boolean isPointsPlay() {
        return pointsPlay;
    }

    public void setPointsPlay(boolean pointsPlay) {
        this.pointsPlay = pointsPlay;
    }

    public boolean isPointsDown() {
        return pointsDown;
    }

    public void setPointsDown(boolean pointsDown) {
        this.pointsDown = pointsDown;
    }

    public int getHits() {
        return hits;
    }

    public void setHits(int hits) {
        this.hits = hits;
    }

    public int getHitsDay() {
        return hitsDay;
    }

    public void setHitsDay(int hitsDay) {
        this.hitsDay = hitsDay;
    }

    public int getHitsWeek() {
        return hitsWeek;
    }

    public void setHitsWeek(int hitsWeek) {
        this.hitsWeek = hitsWeek;
    }

    public int getHitsMonth() {
        return hitsMonth;
    }

    public void setHitsMonth(int hitsMonth) {
        this.hitsMonth = hitsMonth;
    }

    public int getUp() {
        return up;
    }

    public void setUp(int up) {
        this.up = up;
    }

    public int getDown() {
        return down;
    }

    public void setDown(int down) {
        this.down = down;
    }

    public String getScore() {
        return score;
    }

    public void setScore(String score) {
        this.score = score;
    }

    public int getScoreAll() {
        return scoreAll;
    }

    public void setScoreAll(int scoreAll) {
        this.scoreAll = scoreAll;
    }

    public int getScoreNum() {
        return scoreNum;
    }

    public void setScoreNum(int scoreNum) {
        this.scoreNum = scoreNum;
    }

    public String getDuration() {
        return duration;
    }

    public void setDuration(String duration) {
        this.duration = duration;
    }

    public String getTime() {
        return time;
    }

    public void setTime(String time) {
        this.time = time;
    }

    public String getTimeadd() {
        return timeadd;
    }

    public void setTimeadd(String timeadd) {
        this.timeadd = timeadd;
    }

    public List<PlayersDTO> getPlayers() {
        return players;
    }

    public void setPlayers(List<PlayersDTO> players) {
        this.players = players;
    }

    public String getTypeName() {
        return typeName;
    }

    public void setTypeName(String typeName) {
        this.typeName = typeName;
    }

    public String getTypeParentName() {
        return typeParentName;
    }

    public void setTypeParentName(String typeParentName) {
        this.typeParentName = typeParentName;
    }

    public List<String> getTags() {
        return tags;
    }

    public void setTags(List<String> tags) {
        this.tags = tags;
    }

    public List<?> getTopics() {
        return topics;
    }

    public void setTopics(List<?> topics) {
        this.topics = topics;
    }

    public static class PlayersDTO {
        /**
         * name : 蓝光无水印
         * key : alizy
         * sort : 201
         * datas : [{"text":"第58集","play_url":"https://tst.cqzyw.net:11441/data/video/1613698770.m3u8"}]
         */

        @SerializedName("name")
        private String name;
        @SerializedName("key")
        private String key;
        @SerializedName("sort")
        private String sort;
        @SerializedName("datas")
        private List<Object> datas;

        public String getName() {
            if (!TextUtils.isEmpty(name)) {
                name = name.replaceAll(">>", "");
            }
            return name;
        }

        public void setName(String name) {
            this.name = name;
        }

        public String getKey() {
            return key;
        }

        public void setKey(String key) {
            this.key = key;
        }

        public String getSort() {
            return sort;
        }

        public void setSort(String sort) {
            this.sort = sort;
        }

        private final ArrayList<DatasDTO> datasDTOS = new ArrayList<>();

        public List<DatasDTO> getDatas() {
            if (datas != null && datas.size() > 0) {
                if (datasDTOS.isEmpty()) {
                    for (Object data : datas) {
                        if (data instanceof LinkedTreeMap) {
                            DatasDTO datasDTO = new DatasDTO();
                            datasDTO.setPlayUrl(((LinkedTreeMap<?, ?>) data).get("play_url").toString());
                            datasDTO.setText(((LinkedTreeMap<?, ?>) data).get("text").toString());
                            datasDTOS.add(datasDTO);
                        } else {
                            System.out.println();
                        }
                    }
                }
            }
            return datasDTOS;
        }

        public void setDatas(List<Object> datas) {
            this.datas = datas;
        }

        public static class DatasDTO {
            /**
             * text : 第58集
             * play_url : https://tst.cqzyw.net:11441/data/video/1613698770.m3u8
             */

            @SerializedName("text")
            private String text;
            @SerializedName("play_url")
            private String playUrl;
            @SerializedName("isSelect")
            private boolean isSelect;

            public boolean isSelect() {
                return isSelect;
            }

            public void setSelect(boolean select) {
                isSelect = select;
            }

            public String getText() {
                return text;
            }

            public void setText(String text) {
                this.text = text;
            }

            public String getPlayUrl() {
                return playUrl;
            }

            public void setPlayUrl(String playUrl) {
                this.playUrl = playUrl;
            }
        }
    }
}
